package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.FlowerKnowledgeMapper;
import com.ruoyi.system.domain.FlowerKnowledge;
import com.ruoyi.system.service.IFlowerKnowledgeService;

import javax.annotation.Resource;

/**
 * 花卉养殖知识管理Service业务层处理
 * 
 * @author lwb
 * @date 2024-12-26
 */
@Service
public class FlowerKnowledgeServiceImpl implements IFlowerKnowledgeService 
{
    @Resource
    private FlowerKnowledgeMapper flowerKnowledgeMapper;

    /**
     * 查询花卉养殖知识管理
     * 
     * @param id 花卉养殖知识管理主键
     * @return 花卉养殖知识管理
     */
    @Override
    public FlowerKnowledge selectFlowerKnowledgeById(Long id)
    {
        return flowerKnowledgeMapper.selectFlowerKnowledgeById(id);
    }

    /**
     * 查询花卉养殖知识管理列表
     * 
     * @param flowerKnowledge 花卉养殖知识管理
     * @return 花卉养殖知识管理
     */
    @Override
    public List<FlowerKnowledge> selectFlowerKnowledgeList(FlowerKnowledge flowerKnowledge)
    {
        return flowerKnowledgeMapper.selectFlowerKnowledgeList(flowerKnowledge);
    }

    /**
     * 新增花卉养殖知识管理
     * 
     * @param flowerKnowledge 花卉养殖知识管理
     * @return 结果
     */
    @Override
    public int insertFlowerKnowledge(FlowerKnowledge flowerKnowledge)
    {
        flowerKnowledge.setCreateTime(DateUtils.getNowDate());
        return flowerKnowledgeMapper.insertFlowerKnowledge(flowerKnowledge);
    }

    /**
     * 修改花卉养殖知识管理
     * 
     * @param flowerKnowledge 花卉养殖知识管理
     * @return 结果
     */
    @Override
    public int updateFlowerKnowledge(FlowerKnowledge flowerKnowledge)
    {
        flowerKnowledge.setUpdateTime(DateUtils.getNowDate());
        return flowerKnowledgeMapper.updateFlowerKnowledge(flowerKnowledge);
    }

    /**
     * 批量删除花卉养殖知识管理
     * 
     * @param ids 需要删除的花卉养殖知识管理主键
     * @return 结果
     */
    @Override
    public int deleteFlowerKnowledgeByIds(Long[] ids)
    {
        return flowerKnowledgeMapper.deleteFlowerKnowledgeByIds(ids);
    }

    /**
     * 删除花卉养殖知识管理信息
     * 
     * @param id 花卉养殖知识管理主键
     * @return 结果
     */
    @Override
    public int deleteFlowerKnowledgeById(Long id)
    {
        return flowerKnowledgeMapper.deleteFlowerKnowledgeById(id);
    }
}
